package flc.ast.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import flc.ast.R;
import flc.ast.activity.BmiCalculateActivity;
import flc.ast.activity.BmiListActivity;
import flc.ast.activity.DateCalculateActivity;
import flc.ast.activity.ExchangeRateCalculateActivity;
import flc.ast.activity.HouseCalculateActivity;
import flc.ast.activity.RelationCalculateActivity;
import flc.ast.databinding.FragmentFunctionBinding;
import stark.common.basic.base.BaseNoModelFragment;
import stark.common.basic.event.EventStatProxy;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link FunctionFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class FunctionFragment extends BaseNoModelFragment<FragmentFunctionBinding> {


    @Override
    protected int onCreate() {
        return R.layout.fragment_function;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(getActivity(), mDataBinding.event1Container);
        EventStatProxy.getInstance().statEvent5(getActivity(), mDataBinding.event5Container);

        mDataBinding.llHouseCalculate.setOnClickListener(this);
        mDataBinding.llBmiCalculate.setOnClickListener(this);
        mDataBinding.llExchangeRateCalculate.setOnClickListener(this);
        mDataBinding.llDateCalculate.setOnClickListener(this);
        mDataBinding.ivRelationCalculate.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.llHouseCalculate://房贷计算
                startActivity(HouseCalculateActivity.class);
                break;
            case R.id.llBmiCalculate://bmi计算
                startActivity(BmiCalculateActivity.class);
                break;
            case R.id.llExchangeRateCalculate://汇率计算
                startActivity(ExchangeRateCalculateActivity.class);
                break;
            case R.id.llDateCalculate://日期计算
                startActivity(DateCalculateActivity.class);
                break;
            case R.id.ivRelationCalculate://辈分计算
                startActivity(RelationCalculateActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {

    }
}